package org.sean.framework.validator;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.sean.framework.validator.group.ADD;
import org.sean.framework.validator.group.UPDATE;

import javax.validation.constraints.NotBlank;

@Data
public class ValidatorEntity {

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空", groups = {ADD.class, UPDATE.class})
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空", groups = ADD.class)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;
}
